import * as React from 'react';
import * as Icon from '@ant-design/icons';
let myObj: {[index: string]:any} = Icon  //定义 Icon 中的key、value 的类型，避免出现 TS7017的问题(元素隐式具有 "any" 类型，没有索引签名)
interface IAntIconProps {
  iconName: any
}

const AntIcon: React.FunctionComponent<IAntIconProps> = (props):any => {
  let {iconName} = props
  return <>{React.createElement(myObj[iconName])}</>;
};

export default AntIcon;
